package 线程;

/**
 * @author:谢君臣
 * @Date:2021/10/1-23:00
 * @version:1.0
 * @function:
 */
public class Start和Run {
    public static void main(String[] args) {
        Thread thread1 = new Thread(() ->{
            System.out.println(Thread.currentThread().getName()+"打印1");
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        } , "thread1");
        thread1.start();
        Thread thread2 = new Thread(() ->{
            System.out.println(Thread.currentThread().getName()+"打印2");
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        } , "thread2");
        thread2.run();
    }
}
